from dataclasses import dataclass


@dataclass
class CaseInfo:  # 用例信息
    id: str
    skip: bool
    epic: str
    feature: str
    story: str
    title: str
    request: dict
    # 选填信息
    extract: dict = None  # 要提取的信息
    validate: list = None  # 断言信息
    runTheResult: bool = None  # 断言信息

def varify_case_info(case_info: dict):
    try:
        case_info = CaseInfo(**case_info)
    except Exception as e:
        raise e
    return case_info


if __name__ == '__main__':
    pass
    # class A:
    #     def __init__(self, name, age, work=None):
    #         self.xxx=xxx
    #
    # A("wenjun")

    # @dataclass
    # class B:
    #     name: dict
    #     age: int
    #     work: str = None
    #
    #
    # B("wenjun",18)
